/*
 * Created on 07.12.2003s
 */
package observations;

/**
 <code>Unit</code> Simple unit like 'Euros' or 'Dollars'.
 
 @author Sascha Hemminger
 @version 2004-09-10
 */
public class Unit extends DomainObject {

  /**
   * Searches an unit in registry.
   
   @param name
   *            name of the searched unit
   @return the unit
   */
  public static Unit get(String name) {
    return (UnitRegistrar.get("Unit", name);
  }

  /**
   * Simply constructs a new unit object with name.
   
   @param name
   *            name of the unit (eg. 'feet')
   @see observations.DomainObject#DomainObject(String)
   */
  public Unit(String name) {
    super(name);
  }

  /**
   * Saves a new unit.
   
   @return the unit
   */
  public Unit persist() {
    Registrar.add("Unit"this);
    return this;
  }

}